<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .tab_con{
            width:500px;
            height:350px;
            margin:50px auto 0;
        }
        .tab_btns{
            height:50px;
        }
        .tab_btns input{
            width:100px;
            height:50px;
            background:#ddd;
            border:0px;
            outline:none;
        }

        .tab_btns .active{
            background:gold;
        }

        .tab_cons{
            height:300px;
            background:gold;
        }

        .tab_cons div{
            height:300px;
            line-height:300px;
            text-align:center;
            display:none;
            font-size:30px;
        }

        .tab_cons .current{
            display:block;
        }
    </style>
    <script src="js/vue.js"></script>
</head>

<body>
    <div class="tab_con">
        <div class="tab_btns">
            <input type="button" value="按钮一" :class="{active:index==0}" @click=change(0)>
            <input type="button" value="按钮二" :class="{active:index==1}" @click=change(1)>
            <input type="button" value="按钮三" :class="{active:index==2}" @click=change(2)>
        </div>
        <div class="tab_cons">
            <div :class="{current:index==0}">按钮一对应的内容</div>
            <div :class="{current:index==1}">按钮二对应的内容</div>
            <div :class="{current:index==2}">按钮三对应的内容</div>
        </div>
    </div>
    <script>

    // 已知：
    // 让按钮呈现背景颜色为黄色, 需要增加active的类样式
    // 让div显示出来需要增加current样式, 否则则移除current样式
    // 将标签栏切换的效果通过vue的代码实现出来
    var tab_con = new Vue({
        el:'.tab_con',
        data:{
            index:0
        },
        methods:{
            change(i){
                this.index=i
            }
        }
    })
    </script>
</body>
</html>